package fr.generali.sas.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

import fr.generali.sas.model.v1_0.Flux;

public final class FluxRowMapper implements RowMapper<Flux> {
	
	public Flux mapRow(ResultSet rs, int rowNum) throws SQLException {
		Flux f = new Flux();
		f.setIdClient(rs.getString("IDCLIENT"));
		f.setContent(rs.getString("CONTENT"));
		f.setTimestamp(new Date(rs.getTimestamp("DATEINSERTION").getTime()));
		f.setTypeFlux(rs.getString("TYPEFLUX"));
		f.setId(rs.getString("ID"));

		return f;
	}

}
